import 'package:wan_android/utils/request.dart';

var res = {
  "data": {
    "coinInfo": {
      "coinCount": 36662,
      "level": 367,
      "nickname": "",
      "rank": "3",
      "userId": 2,
      "username": "x**oyang"
    },
    "userInfo": {
      "admin": false,
      "chapterTops": [],
      "coinCount": 36662,
      "collectIds": [
      ],
      "email": "623565791@qq.com",
      "icon": "", 
      "id": 2,
      "nickname": "鸿洋",
      "password": "",
      "publicName": "鸿洋", 
      "token": "",
      "type": 0,
      "username": "xiaoyang"
    }
  },
  "errorCode": 0,
  "errorMsg": ""
};

// 用户信息
getUserInfo() async {
  var response = await Request().request('/user/lg/userinfo/json');
  return response;
}

// 用户登录
login(data) async {
  var response = await Request().request('/user/login', method: DioMethod.post, data: data);
  return response;
}

// 用户注册
register( data) async {
  var response = await Request().request('/user/register', method: DioMethod.post, data: data);
  return response;
}

// 退出登录
logout() async {
  var response = await Request().request('/user/logout/json');
  return response;
}